<div class="container">
    <h1 id="pkg-overview">package subtle</h1>
    <p><code>import "crypto/subtle"</code>
    </p><p>Package subtle implements functions that are often useful in cryptographic
        code but require careful thought to use correctly.</p>
    
    
		
        
        
        
        
        
        
    
    <h2 id="ConstantTimeByteEq">func <a href="https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go?name=release#31" title="View Source">ConstantTimeByteEq</a> </h2>
    <pre class="funcdecl">func ConstantTimeByteEq(x, y <a href="builtin.htm#uint8">uint8</a>) <a href="builtin.htm#int">int</a></pre>
    <p>如果x == y返回1，否则返回0。</p>
    <h2 id="ConstantTimeEq">func <a href="https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go?name=release#41" title="View Source">ConstantTimeEq</a> </h2>
    <pre class="funcdecl">func ConstantTimeEq(x, y <a href="builtin.htm#int32">int32</a>) <a href="builtin.htm#int">int</a></pre>
    <p>如果x == y返回1，否则返回0。</p>
    <h2 id="ConstantTimeLessOrEq">func <a href="https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go?name=release#70" title="View Source">ConstantTimeLessOrEq</a> </h2>
    <pre class="funcdecl">func ConstantTimeLessOrEq(x, y <a href="builtin.htm#int">int</a>) <a href="builtin.htm#int">int</a></pre>
    <p>如果x &lt;= y返回1，否则返回0；如果x或y为负数，或者大于2**31-1，函数行为是未定义的。</p>
    <h2 id="ConstantTimeCompare">func <a href="https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go?name=release#12" title="View Source">ConstantTimeCompare</a> </h2>
    <pre class="funcdecl">func ConstantTimeCompare(x, y []<a href="builtin.htm#byte">byte</a>) <a href="builtin.htm#int">int</a></pre>
    <p>如果x、y的长度和内容都相同返回1；否则返回0。消耗的时间正比于切片长度而与内容无关。</p>
    <h2 id="ConstantTimeCopy">func <a href="https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go?name=release#55" title="View Source">ConstantTimeCopy</a> </h2>
    <pre class="funcdecl">func ConstantTimeCopy(v <a href="builtin.htm#int">int</a>, x, y []<a href="builtin.htm#byte">byte</a>)</pre>
    <p>如果v == 1,则将y的内容拷贝到x；如果v == 0，x不作修改；其他情况的行为是未定义并应避免的。</p>
    <h2 id="ConstantTimeSelect">func <a href="https://github.com/golang/go/blob/master/src/crypto/subtle/constant_time.go?name=release#28" title="View Source">ConstantTimeSelect</a> </h2>
    <pre class="funcdecl">func ConstantTimeSelect(v, x, y <a href="builtin.htm#int">int</a>) <a href="builtin.htm#int">int</a></pre>
    <p>如果v == 1，返回x；如果v == 0，返回y；其他情况的行为是未定义并应避免的。</p>
</div>